<?php
namespace Addons\TimedTask;

use Services\Service;
use Models\BaseModel as Model;

class Helper extends Service
{
    //获取域名
	public function get_http_server_name(){
		$http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';
		return  $http_type.$_SERVER['HTTP_HOST'];
	}

	//根据level_manager  id获取sequence
	public function get_sequence_by_id($id){
		$level_manager = (new \Model('qy_level_manager'))->find($id)->get_model_array();
		return $level_manager;
	}
}
